package com.lvyq.myplayer.model.index

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.lvyq.myplayer.net.api.indexDailyPlayApiService
import kotlinx.coroutines.launch

/**
 * 文件描述：IndexZaiTingModel 热门单曲
 * 作者：lvyq
 * 创建时间：2025-04-08
 * 修改时间：2025-04-08
 */
class IndexHotSongModel : ViewModel() {
    private val _date = MutableLiveData<IndexHotSongBean>()
    val data:LiveData<IndexHotSongBean> = _date

    fun getHeatSongLst(){
        Thread.sleep(100)
        viewModelScope.launch {
            var response = indexDailyPlayApiService.getHeatSongLst()
            if (response.isSuccessful){
                _date.value=response.body()
            }
        }
    }
}